package com.kamistoat.meimeimall.common.taskEngine;

import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.*;

@Component
public class TaskEngine {
    public void execute(EngineTaskDetail engineTaskDetail) {
        if (engineTaskDetail.getThreadPoolExecutor() != null) {
            engineTaskDetail.getThreadPoolExecutor().submit(engineTaskDetail);
        } else {
            engineTaskDetail.run();
        }
    }
}

